package com.threeox.commonlibrary.inter;

import com.threeox.commonlibrary.entity.engine.request.base.BaseRequestMsg;

/**
 *
 * @ClassName: OnRequestListener
 *
 * @Description: Todo(RequestHelper 请求的回调)
 *
 * @author 赵屈犇
 *
 * @date 创建时间:2016/12/21 16:06
 *
 * @version 1.0
 */
public interface OnRequestListener<T> {

    /**
     * 请求成功
     *
     * @param requestMsg
     * @param url
     * @param id
     * @param msg
     * @param data
     */
    void onSuccess(BaseRequestMsg requestMsg, String url, int id, String msg, T data);

    /**
     * 请求失败
     *
     * @param requestMsg
     * @param url
     * @param id
     * @param code
     * @param msg
     * @param data
     */
    void onError(BaseRequestMsg requestMsg, String url, int id, Object code, String msg, Object data);

    /**
     * 加载中...
     *
     * @param requestMsg
     * @param progress
     * @param total
     * @param id
     * @param url
     */
    void inProgress(BaseRequestMsg requestMsg, float progress, long total, int id, String url);

}
